package com.hpeu_01.day0122.homework.test02;


import java.io.*;

/**
 * 第二题：利用BufferedWriter在名为English.txt中写入字符串（自己定义字符串），
 * 再利用BufferedReader读出来并打印在控制台上。
 * D:\project\JAVA\java\JavaSE\src\com\hpeu_01\day0122\homework\test02\English.txt
 */
public class Test02 {
    public static void main(String[] args) throws Exception{

        BufferedWriter writer = new BufferedWriter(new FileWriter("D:\\project\\JAVA\\java\\JavaSE\\src\\com\\hpeu_01\\day0122\\homework\\test02\\English.txt"));
        BufferedReader reader = new BufferedReader(new FileReader("D:\\project\\JAVA\\java\\JavaSE\\src\\com\\hpeu_01\\day0122\\homework\\test02\\English.txt"));
        writer.write("hello English");
        writer.close();
        char[] ch = new char[1024];
        int len = -1;
        while ((len = reader.read(ch)) != -1) {
            System.out.println(new String(ch, 0, len));

        }
        reader.close();
    }
}
